﻿using System;
using System.Runtime.Serialization;

/**
异常基类
**/
namespace open_api_sdk_csharp.com.chinaums.open.api
{
    public class OpenApiException : Exception
    {
        private string errCode;
        private string errInfo;
        public OpenApiException() : base()
        {
        }

        public OpenApiException(string message)
            : base(message)
        {
        }

        protected OpenApiException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        public OpenApiException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        public OpenApiException(string errorCode, string errorMsg)
            : base(errorCode + ":" + errorMsg)
        {
            this.errCode = errorCode;
            this.errInfo = errorMsg;
        }

        public string ErrorCode
        {
            get { return this.errCode; }
        }

        public string ErrorMsg
        {
            get { return this.errInfo; }
        }
    }
}
